home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 70 / 070.d81 / screen demo (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  473 lines

  1. 10 sys57812"screenmaster.o",8,0:poke780,0:poke781,0:poke782,192:sys65493
  2. 20 sys49152
  3. 30 color 3,0,0:printchr$(142)chr$(8)
  4. 40 print"[147]         s c r e e n   m a s t e r"
  5. 50 printtab(18)"d e m o"
  6. 60 :
  7. 70 rem: read window words
  8. 80 :
  9. 90 dim wc$(3,7)
  10. 100 dim dr$(144)
  11. 110 dim gn$(100),cm$(100),gb$(100)
  12. 120 :
  13. 130 for i=1 to 3
  14. 140 read wc$(1,i)
  15. 150 next
  16. 160 :
  17. 170 for i=1 to 7
  18. 180 read wc$(2,i)
  19. 190 next
  20. 200 :
  21. 210 for i=1 to 4
  22. 220 read wc$(3,i)
  23. 230 next
  24. 240 :
  25. 400 :
  26. 410 rem: get window to open
  27. 420 :
  28. 430 gosub 550
  29. 440 get a$:if a$="" then 440
  30. 450 if a$="d" then wn=1
  31. 460 if a$="c" then wn=2
  32. 470 if a$="h" then wn=3
  33. 480 if wn<>0 then gosub 1600
  34. 490 goto 440
  35. 500 :
  36. 510 :
  37. 520 rem: top window
  38. 530 rem: save copy to screen 3
  39. 540 :
  40. 550 locate 3,0
  41. 560 print"[129][213][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][201]";
  42. 570 fori=0to17:print"[221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221]";:next
  43. 580 print"[202][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][203]"
  44. 590 fori=217to242:pokei,peek(i)or128:next:rem fix line links
  45. 600 color 15,0,6
  46. 610 frame 2,0,0,2,0,39
  47. 620 home
  48. 630 print "   d[146]irectory   disk c[146]ommand   h[146]elp";
  49. 640 wn=0
  50. 650 locate 23,6
  51. 660 print "enter d[155], c[155] or h[155] to open window"
  52. 670 pcopy 0,3
  53. 680 return
  54. 690 :
  55. 700 :
  56. 710 :
  57. 720 rem: disk window
  58. 730 :
  59. 740 frame 6,0,2,8,3,15
  60. 750 color 3,0,6
  61. 760 locate ft%+2,fl%+1
  62. 770 print wc$(1,1)
  63. 780 locate ft%+3,fl%+1
  64. 790 print wc$(1,2)
  65. 800 locate ft%+4,fl%+1
  66. 810 print wc$(1,3)
  67. 820 wn=1:rw=ft%+2
  68. 830 gosub 3320
  69. 840 goto 1660
  70. 850 :
  71. 860 :
  72. 870 rem: disk command window
  73. 880 :
  74. 890 frame 6,0,2,12,15,29
  75. 900 color 3,0,6
  76. 910 locate ft%+2,fl%+1
  77. 920 print wc$(2,1)
  78. 930 locate ft%+3,fl%+1
  79. 940 print wc$(2,2)
  80. 950 locate ft%+4,fl%+1
  81. 960 print wc$(2,3)
  82. 970 locate ft%+5,fl%+1
  83. 980 print wc$(2,4)
  84. 990 locate ft%+6,fl%+1
  85. 1000 print wc$(2,5)
  86. 1010 locate ft%+7,fl%+1
  87. 1020 print wc$(2,6)
  88. 1030 locate ft%+8,fl%+1
  89. 1040 print wc$(2,7)
  90. 1050 wn=2:rw=ft%+2
  91. 1060 gosub 3320
  92. 1070 goto 1660
  93. 1080 :
  94. 1090 :
  95. 1100 rem: help window
  96. 1110 :
  97. 1120 frame 6,0,2,9,28,39
  98. 1130 color 3,0,6
  99. 1140 locate ft%+2,fl%+1
  100. 1150 print wc$(3,1)
  101. 1160 locate ft%+3,fl%+1
  102. 1170 print wc$(3,2)
  103. 1180 locate ft%+4,fl%+1
  104. 1190 print wc$(3,3)
  105. 1200 locate ft%+5,fl%+1
  106. 1210 print wc$(3,4)
  107. 1220 wn=3:rw=ft%+2
  108. 1230 gosub 3320
  109. 1240 goto 1660
  110. 1250 :
  111. 1280 :
  112. 1290 rem: move cursor up and down
  113. 1300 :
  114. 1310 gosub 1830
  115. 1320 if a$="" then rw=rw+1
  116. 1330 if a$="[145]" then rw=rw-1
  117. 1340 if rw=fb%-1 then rw=ft%+2
  118. 1350 if rw=ft%+1 then rw=fb%-2
  119. 1360 gosub 1760
  120. 1370 goto 1660
  121. 1380 :
  122. 1390 :
  123. 1400 :
  124. 1410 rem: move window right and left
  125. 1420 :
  126. 1430 if a$="" then wn=wn+1
  127. 1440 if a$="[157]" then wn=wn-1
  128. 1450 if wn=0 then wn=3
  129. 1460 if wn=4 then wn=1
  130. 1470 pcopy 3,0
  131. 1480 goto 1600
  132. 1490 :
  133. 1500 :
  134. 1510 :
  135. 1520 rem: exit windows
  136. 1530 pcopy 3,0
  137. 1540 return
  138. 1550 :
  139. 1560 :
  140. 1570 :
  141. 1580 rem: open current window
  142. 1590 rem: after messed up
  143. 1600 on wn goto 740,890,1120
  144. 1610 :
  145. 1620 :
  146. 1630 :
  147. 1640 rem: control while in a window
  148. 1650 :
  149. 1660 gosub 1760
  150. 1670 get a$:if a$="" then 1670
  151. 1680 if a$="[157]" or a$="" then 1430
  152. 1690 if a$="" or a$="[145]" then 1310
  153. 1700 if a$=chr$(13) then 2280
  154. 1710 goto 1670
  155. 1720 :
  156. 1730 :
  157. 1740 rem: reverse cursor
  158. 1750 :
  159. 1760 locate rw,fl%+1
  160. 1770 print ""wc$(wn,rw-3);"[146]";
  161. 1780 return
  162. 1790 :
  163. 1800 :
  164. 1810 rem: un reverse cursor
  165. 1820 :
  166. 1830 locate rw,fl%+1
  167. 1840 print"[159]"wc$(wn,rw-3);
  168. 1850 return
  169. 1860 :
  170. 1870 :
  171. 1880 :
  172. 1890 rem:  input a filename
  173. 1900 :
  174. 1910 pcopy 0,1
  175. 1920 j%=len(mg$)+4:if j%<20 then j%=20
  176. 1930 frame 2,0,10,15,8,j%+7
  177. 1940 :
  178. 1950 locate ft%+2,fl%+2
  179. 1960 print mg$
  180. 1970 locate ft%+4,fl%+2
  181. 1980 for i=1 to 16
  182. 1990 print "-";
  183. 2000 next
  184. 2010 :
  185. 2020 locate ft%+4,fl%+2
  186. 2030 ni=0:ff$=""
  187. 2040 :
  188. 2050 geta$:if a$="" then 2050
  189. 2060 if a$<>chr$(20)then 2130
  190. 2070 if ni=0 then 2050
  191. 2080 print "[157]-[157]";
  192. 2090 ni=ni-1
  193. 2100 ff$=left$(ff$,len(ff$)-1)
  194. 2110 goto 2050
  195. 2120 :
  196. 2130 if a$=chr$(13) then 2210
  197. 2140 if a$<" " or a$>"_" then 2050
  198. 2150 if ni=16 then 2050
  199. 2160 ni=ni+1
  200. 2170 print a$;
  201. 2180 ff$=ff$+a$
  202. 2190 goto 2050
  203. 2200 :
  204. 2210 pcopy 1,0
  205. 2220 return
  206. 2230 :
  207. 2240 :
  208. 2250 rem: determine which command
  209. 2260 rem: was picked
  210. 2270 :
  211. 2280 pcopy 0,1
  212. 2290 j=rw-3
  213. 2300 on wn goto 2310,2320,2330
  214. 2310 on j goto 3390,2470,2390
  215. 2320 on j goto 2690,2810,2990,2870,2930,3070,2390
  216. 2330 on j goto 5090,5270,5940,2390
  217. 2340 pcopy 1,0
  218. 2350 goto 1660
  219. 2360 :
  220. 2370 :
  221. 2380 rem: exit a window
  222. 2390 gosub 1830
  223. 2400 pcopy 3,0
  224. 2410 wn=0
  225. 2420 goto 440
  226. 2430 :
  227. 2440 :
  228. 2450 rem: quit program
  229. 2460 :
  230. 2470 color 0,0,0
  231. 2480 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  232. 2490 ifer<>63thenprint"[159]":end
  233. 2500 print"[147]quit"
  234. 2510 print"load"chr$(34)"hello connect"chr$(34)",8"
  235. 2520 print"run"
  236. 2530 poke631,13:poke632,13:poke633,13:poke198,3:end
  237. 2540 :
  238. 2550 :
  239. 2560 rem: send disk command in dc$
  240. 2570 :
  241. 2580 open15,8,15,dc$
  242. 2590 input#15,a$,b$,c$,d$
  243. 2600 mg$=a$+" "+b$+"[160]"+c$+" "+d$
  244. 2610 gosub 3180
  245. 2620 gosub 3260
  246. 2625 print#15,dc$
  247. 2630 close15
  248. 2640 goto 1600
  249. 2650 :
  250. 2660 :
  251. 2670 rem: full new
  252. 2680 :
  253. 2690 mg$="enter new disk name"
  254. 2700 gosub 1910
  255. 2710 b$=ff$
  256. 2720 mg$="enter new disk id"
  257. 2730 gosub 1910
  258. 2740 dc$="n:"+b$+","+left$(ff$,2)
  259. 2750 goto 1670
  260. 2760 :
  261. 2770 :
  262. 2780 :
  263. 2790 rem: short new
  264. 2800 :
  265. 2810 dc$="n:"
  266. 2820 goto 1670
  267. 2830 :
  268. 2840 :
  269. 2850 rem: validate
  270. 2860 :
  271. 2870 dc$="v:"
  272. 2880 goto 2580
  273. 2890 :
  274. 2900 :
  275. 2910 rem: init disk
  276. 2920 :
  277. 2930 dc$="i:"
  278. 2940 goto 2580
  279. 2950 :
  280. 2960 :
  281. 2970 rem: delete
  282. 2980 :
  283. 2990 mg$="name of file to delete"
  284. 3000 gosub 1910
  285. 3010 dc$="s:"+ff$
  286. 3020 goto 1670
  287. 3030 :
  288. 3040 :
  289. 3050 rem: rename
  290. 3060 :
  291. 3070 mg$="old file name"
  292. 3080 gosub 1910
  293. 3090 b$=ff$
  294. 3100 mg$="new file name"
  295. 3110 gosub 1910
  296. 3120 dc$="r:"+ff$+"="+b$
  297. 3130 goto 2580
  298. 3140 :
  299. 3150 :
  300. 3160 rem: message window
  301. 3170 :
  302. 3180 pcopy 0,1
  303. 3190 l=int((40-len(mg$)-3)/2)
  304. 3200 r=l+len(mg$)+3
  305. 3210 frame 1,0,10,14,l,r
  306. 3220 locate ft%+2,fl%+2
  307. 3230 print mg$
  308. 3240 return
  309. 3250 :
  310. 3260 get a$:if a$="" then 3260
  311. 3270 pcopy 1,0
  312. 3280 return
  313. 3290 :
  314. 3300 :
  315. 3310 rem:  print bottom help line
  316. 3320 locate 23,2
  317. 3330 print"crsr up[155]/down[155]/left[155]/right  [155]then return "
  318. 3340 return
  319. 3350 :
  320. 3360 :
  321. 3370 rem:  directory
  322. 3380 :
  323. 3390 mg$="reading directory"
  324. 3400 gosub 3180
  325. 3410 :
  326. 3420 open15,8,15,"i"
  327. 3430 open 1,8,0,"$0"
  328. 3440 :
  329. 3450 for i=1to30:get#1,a$:next
  330. 3460 :
  331. 3470 nf=0
  332. 3480 ff$=""
  333. 3490 get#1,a$:ifstthen3570
  334. 3500 ifa$<>chr$(34)then3480
  335. 3510 get#1,a$:ifstthen3570
  336. 3520 ifa$<>chr$(34)thenff$=ff$+a$:goto3510
  337. 3530 nf=nf+1
  338. 3540 dr$(nf)=ff$
  339. 3550 goto 3480
  340. 3560 :
  341. 3570 close1:close15
  342. 3580 :
  343. 3590 rem: directory window
  344. 3600 :
  345. 3610 pcopy 1,0
  346. 3620 tp=1
  347. 3630 frame 1,0,3,23,10,30
  348. 3640 locate fb%-2,fl%
  349. 3650 print "[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
  350. 3660 print "[159]"
  351. 3670 locate fb%-1,fl%+1
  352. 3680 print " e[146]xit  crsr up/down"
  353. 3690 :
  354. 3700 :
  355. 3710 for i=1 to 17
  356. 3720 locate i+ft%,fl%+2
  357. 3730 if tp+i-1 >nf then i=17:goto 3750
  358. 3740 print dr$(tp+i-1)
  359. 3750 next
  360. 3760 :
  361. 3770 rem: control in directory
  362. 3780 :
  363. 3790 geta$:if a$="" then 3790
  364. 3800 if a$<>"" then 3860
  365. 3810 if tp+17>nf then 3790
  366. 3820 tp=tp+17
  367. 3830 clear
  368. 3840 goto 3640
  369. 3850 :
  370. 3860 if a$<>"[145]" then 3920
  371. 3870 if tp=1 then 3790
  372. 3880 tp=tp-17
  373. 3890 clear
  374. 3900 goto 3640
  375. 3910 :
  376. 3920 if a$<>"e" then 3790
  377. 3930 pcopy 1,0
  378. 3940 goto 1600
  379. 3950 :
  380. 3960 :
  381. 3970 :
  382. 3980 rem: print help options
  383. 3990 :
  384. 4000 if j=2 then :locate 24,10:print"e[146]xit  cursor up/down";
  385. 4010 if j<>2 then :locate 24,17:print "e[146]xit";
  386. 4020 locate 0,0
  387. 4030 return
  388. 4040 :
  389. 4890 :
  390. 4900 rem: data for window choices
  391. 4910 :
  392. 4920 data " directory "," quit      "
  393. 4930 data " escape    "," full new    "
  394. 4940 data " short new   "
  395. 4950 data " delete file "
  396. 4960 data " validate    "
  397. 4970 data " initialize  "
  398. 4980 data " rename file "
  399. 4990 data " escape      "
  400. 5000 data " general  "," commands "
  401. 5010 data " grabber  "," escape   "
  402. 5020 :
  403. 5030 r